import { IsNotEmpty, ValidateIf, MinLength } from 'class-validator'
import { IsPasswordFormat, IsPhoneFormat } from '../validator/validate.admin'
export class CreateAdminDto {
    id: number
    @IsNotEmpty({message: '账号不能为空'})
    account: string
    @ValidateIf(r => !r.id)
    @IsNotEmpty({message: '密码不能为空'})
    @IsPasswordFormat()
    password: string
    @IsNotEmpty({message: '昵称不能为空'})
    nickname: string
    @IsNotEmpty({message: '手机号不能为空'})
    @IsPhoneFormat({message: '手机格式有误'})
    mobile: string
}

export class LoginAdminDto {
    @IsNotEmpty({message: '账号不能为空'})
    account: string
    @IsNotEmpty({message: '密码不能为空'})
    password: string
}

export class RoleAdminDto {
    @IsNotEmpty({message: '参数错误'})
    roleId: number
    adminIds: any
}

export class SetPwdDto {
    @IsNotEmpty({message: '密码不能为空'})
    @IsPasswordFormat()
    newPassword: string
    confirmPassword: string
    id: number
}


